﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ChanPin_Out.aspx.cs" Inherits="syc.Store.ChanPin_Out" %>
<html>
<head></head>
<body>
<script type="text/javascript" language="javascript" src="/common.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
    
    

    // Use jQuery via jQuery(...)
    jQuery(document).ready(function() {
    var onoroff = 0;

        $("#search").click(function() {

            $("#Panel3").toggle();
            if (onoroff == 0) { $("#search").val("模糊查询"); onoroff = 1; } else { $("#search").val("隐藏模糊查询"); onoroff = 0; }
        });
    });
    
    var list = new Array();
    //按下插入键所调用的子程序
    function ins(number) {
        var copy = 1;
        
        //遍历整个数组，如果有重复则置标记copy为0,无重复则不做任何事情
        $.each(list, function(index, value) {
        //alert(value);
        if (number != value) { } else { copy = 0;}
        });
        //将当前插入项目记录下来，可惜这个列表会快速增长【有机会再去改进它】
        list.push(number);
        //遍历28行，找到空位就插入        
        for (i = 1; i <= 28; i++) {
            var kunhao_text = $("#KunHao" + i.toString()).val();
            if (kunhao_text == "" && copy) {
                alert(list);
                $("#KunHao" + i.toString()).val(number);
                i = 30;
            }
        }//遍历结束
    }
						
</script>
    <form id="form1" runat="server">
    <div id="wintop" class="wintop">产品出库单</div>
        <asp:Panel ID="Panel1" runat="server" CssClass="panel">
            <asp:Button ID="Button_Calc" runat="server" Text="数据校验" CssClass="button" 
                UseSubmitBehavior="False" onclick="Button_Calc_Click" />
            <asp:Button ID="Button_Finish" runat="server" Text="保 存" CssClass="button" 
                UseSubmitBehavior="False" onclick="Button_Finish_Click" />
           <input type="button" value="导出到Word" class="button" onclick="Export();" style="font-weight:normal;font-size:12px;" />
           <input id="search" type="button" value="隐藏模糊查询" class="button" style="font-weight:normal;font-size:12px;" />           
           <input type="button" value="关 闭" class="button" onclick="parent.swin_close();" />
           
           
           <asp:Panel ID="Panel3" runat="server" CssClass="panel" GroupingText="查 询">
                捆号：<asp:TextBox ID="number" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox>
                &nbsp;重量：<asp:TextBox ID="weight" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox>
                &nbsp;长度：<asp:TextBox ID="llength" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox>
                &nbsp; 支数：<asp:TextBox ID="zhishu" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox>
                &nbsp;
                </br>
                生产年份:
                <asp:DropDownList ID="DL_year" runat="server">
                    <asp:ListItem Value="0">全部</asp:ListItem>
                    <asp:ListItem>2009</asp:ListItem>
                    <asp:ListItem>2010</asp:ListItem>
                    <asp:ListItem>2011</asp:ListItem>
                    <asp:ListItem>2012</asp:ListItem>
                    <asp:ListItem>2013</asp:ListItem>
                    <asp:ListItem>2014</asp:ListItem>
                    <asp:ListItem>2015</asp:ListItem>
                    <asp:ListItem>2016</asp:ListItem>
                    <asp:ListItem>2017</asp:ListItem>
                    <asp:ListItem>2018</asp:ListItem>
                </asp:DropDownList>
                &nbsp; 生产月份:
                <asp:DropDownList ID="DL_month" runat="server">
                    <asp:ListItem Value="0">全部</asp:ListItem>
                    <asp:ListItem>1</asp:ListItem>
                    <asp:ListItem>2</asp:ListItem>
                    <asp:ListItem>3</asp:ListItem>
                    <asp:ListItem>4</asp:ListItem>
                    <asp:ListItem>5</asp:ListItem>
                    <asp:ListItem>6</asp:ListItem>
                    <asp:ListItem>7</asp:ListItem>
                    <asp:ListItem>8</asp:ListItem>
                    <asp:ListItem>9</asp:ListItem>
                    <asp:ListItem>10</asp:ListItem>
                    <asp:ListItem>11</asp:ListItem>
                    <asp:ListItem>12</asp:ListItem>
                </asp:DropDownList>
                &nbsp;&nbsp;生产分厂:<asp:Label ID="Label_FenChang" runat="server" Text="Label"></asp:Label>
&nbsp;<asp:Button ID="Button_Query" runat="server" CssClass="smallbutton" 
                    onclick="Button_Query_Click" Text="查 询" UseSubmitBehavior="true" />
                <br />
                <br />
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                    DataKeyNames="ID" DataSourceID="SqlDataSource4">
                    <Columns>
                        <asp:TemplateField HeaderText="ID" InsertVisible="False" SortExpression="ID">
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("ID") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="入库单序号" SortExpression="序号">
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%# Bind("序号") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("序号") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="捆号" SortExpression="捆号">
                            <ItemTemplate>
                                <asp:Label ID="Label3" runat="server" Text='<%# Bind("捆号") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("捆号") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="炉号" SortExpression="炉号">
                            <ItemTemplate>
                                <asp:Label ID="Label4" runat="server" Text='<%# Bind("炉号") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("炉号") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="重量" SortExpression="重量">
                            <ItemTemplate>
                                <asp:Label ID="Label5" runat="server" Text='<%# Bind("重量") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("重量") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="长度" SortExpression="长度">
                            <ItemTemplate>
                                <asp:Label ID="Label6" runat="server" Text='<%# Bind("长度") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("长度") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="支数" SortExpression="支数">
                            <ItemTemplate>
                                <asp:Label ID="Label7" runat="server" Text='<%# Bind("支数") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("支数") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="生产日期" SortExpression="生产日期">
                            <ItemTemplate>
                                <asp:Label ID="Label8" runat="server" Text='<%# Bind("生产日期", "{0:d}") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("生产日期") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="入库单备注" SortExpression="入库单备注">
                            <ItemTemplate>
                                <asp:Label ID="Label9" runat="server" Text='<%# Bind("入库单备注") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("入库单备注") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <input class="smallbutton" 
                                    onclick='parent.swin_load(&#039;/Fc/产品入库.aspx?id=<%# Eval("ID")%>&#039;);' 
                                    type="button" value="明 细" /> &nbsp;
                                <input ID="Button1" class="smallbutton" onclick='ins(<%# Eval("捆号")%>)' 
                                    type="button" value="插入" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>">
                </asp:SqlDataSource>
                <br />
                </br> 
            </asp:Panel>
            
        </asp:Panel>

        <asp:Panel ID="Panel2" runat="server" CssClass="panel2">
            <asp:Label ID="Message" runat="server" Text="·准备就绪" CssClass="prompt"></asp:Label>
        </asp:Panel>


<asp:SqlDataSource ID="SqlDataSource3" runat="server" 
ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
SelectCommand="SELECT [Value] FROM [系统变量] where [Name]='仓储主管'">
</asp:SqlDataSource>

        <script>            putBillHead();</script>
        
    <table id="qdtitle" border="0" cellpadding="3" style="width:911px;border-collapse: collapse;font-size:14px; padding:5px;">
        <tr>
	        <td style="font-size:24px;" colspan="3" align="center">陕西延长石油材料有限公司        <tr>
	        <td width="33%">  </td>
	        <td width="34%" style="font-size:24px;" align="center">产品出库清单</td>
	        <td width="33%" align="right">编码：SYC/ZJ-WL-20</td>
        </tr>
        <tr>
	        <td>　</td>
	        <td>　</td>
	        <td align="right">
	            <img alt="" src="/Icons/29.png" align="middle"
	            onclick="makecalendar(document.getElementById('RiQi').value, document.getElementById('RiQi'));" /><asp:TextBox ID="RiQi" runat="server" CssClass="intxt1" 
                        Width="120px"></asp:TextBox>
            </td>
        </tr>
    </table>
    <table id=qd border="1" cellspacing="0" cellpadding="0" style="width:911px;text-align:center;border-collapse: collapse;font-size:14px;" bordercolor="#333333">
        <tr>
	        <td style="height:24px;" align="center">订货单位</td>
	        <td align="center" colspan="2"><asp:TextBox ID="DingHuo" runat="server" 
                    CssClass="blank_center" ReadOnly="True"></asp:TextBox>
                    </td>
	        <td align="center">技术条件</td>
	        <td align="center">API Spec5CT</td>
	        <td align="center">合 同 号</td>
	        <td align="center" colspan="2"><asp:TextBox ID="HeTongHao" runat="server" 
                    CssClass="blank_center" ReadOnly="True"></asp:TextBox>
                    </td>
	        <td align="center">序 号</td>
	        <td align="center">
                <asp:TextBox ID="DanHao" runat="server" CssClass="intxt1"></asp:TextBox>
                　</td>
        </tr>
        <tr>
	        <td style="height:24px;" align="center">产品类别</td>
	        <td>
                <asp:TextBox ID="ChanPin" runat="server" 
                    CssClass="blank_center" ReadOnly="True"></asp:TextBox>
            </td>
	        <td align="center">
			<p align="center">钢级</td>
	        <td align="center"><asp:TextBox ID="GangJi" runat="server" CssClass="blank_center" 
                    ReadOnly="True">J55</asp:TextBox>
            </td>
	        <td align="center">规格(mm)</td>
	        <td><asp:TextBox ID="GuiGe" runat="server" CssClass="blank_center" 
                    ReadOnly="True"></asp:TextBox>
            </td>
	        <td align="center">总支数</td>
	        <td><asp:TextBox ID="ZongZhiShu" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox>
            </td>
	        <td align="center">生产单位</td>
	        <td>
                <asp:DropDownList ID="ShengChan" runat="server" 
                    Width="90px" AutoPostBack="True" 
                    onselectedindexchanged="ShengChan_SelectedIndexChanged">
                    <asp:ListItem Value="1">一分厂</asp:ListItem>
                    <asp:ListItem Value="2">二分厂</asp:ListItem>
                    <asp:ListItem Value="5">五分厂</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
	        <td style="height:24px;">
			<p align="center">总重量(吨)</td>
	        <td colspan="2">
                <asp:TextBox ID="ZongZhong" runat="server" CssClass="blank_center" 
                    ReadOnly="True"></asp:TextBox>
            </td>
	        <td>
			<p align="center">总件数</td>
	        <td><asp:TextBox ID="ZongJian" runat="server" CssClass="blank_center" 
                    ReadOnly="True"></asp:TextBox>
            </td>
	        <td>
			<p align="center">总长度m</td>
	        <td colspan="2">
                <asp:TextBox ID="ZongChang" runat="server" CssClass="blank_center" 
                    ReadOnly="True"></asp:TextBox>
            </td>
	        <td>
			<p align="center">发货方式</td>
	        <td><asp:TextBox ID="FaHuoFangShi" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox>
                    </td>
        </tr>
        <tr>
	        <td style="width:90px;height:24px;" align="center">原料供货商</td>
	        <td style="width:90px;" align="center">炉号</td>
	        <td style="width:90px;" align="center">捆数编号</td>
	        <td style="width:90px;" align="center">捆重量(kg)</td>
	        <td style="width:90px;" align="center">捆长度(m)</td>
	        <td style="width:90px;" align="center">原料供货商</td>
	        <td style="width:90px;" align="center">炉号</td>
	        <td style="width:90px;" align="center">捆数编号</td>
	        <td style="width:90px;" align="center">捆重量(kg)</td>
	        <td style="width:90px;" align="center">捆长度(m)</td>
        </tr>
        <tr>
	        <td><asp:TextBox ID="GongHuo1" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao1" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao1" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong1" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang1" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>

	        <td><asp:TextBox ID="GongHuo15" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao15" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao15" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong15" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang15" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
        </tr>


        <tr>
	        <td><asp:TextBox ID="GongHuo2" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao2" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao2" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong2" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang2" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        
	        <td><asp:TextBox ID="GongHuo16" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao16" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao16" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong16" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang16" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
        </tr>

        <tr>
	        <td><asp:TextBox ID="GongHuo3" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao3" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao3" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong3" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang3" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        
	        <td><asp:TextBox ID="GongHuo17" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao17" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao17" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong17" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang17" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
        </tr>

        <tr>
	        <td><asp:TextBox ID="GongHuo4" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao4" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao4" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong4" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang4" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        
	        <td><asp:TextBox ID="GongHuo18" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao18" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao18" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong18" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang18" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
        </tr>

        <tr>
	        <td><asp:TextBox ID="GongHuo5" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao5" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao5" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong5" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang5" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        
	        <td><asp:TextBox ID="GongHuo19" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao19" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao19" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong19" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang19" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
        </tr>

        <tr>
	        <td><asp:TextBox ID="GongHuo6" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao6" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao6" runat="server" CssClass="intxt1" Height="22px"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong6" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang6" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        
	        <td><asp:TextBox ID="GongHuo20" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao20" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao20" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong20" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang20" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
        </tr>

        <tr>
	        <td><asp:TextBox ID="GongHuo7" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao7" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao7" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong7" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang7" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        
	        <td><asp:TextBox ID="GongHuo21" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao21" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao21" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong21" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang21" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
        </tr>

        <tr>
	        <td><asp:TextBox ID="GongHuo8" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao8" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao8" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong8" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang8" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        
	        <td><asp:TextBox ID="GongHuo22" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao22" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao22" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong22" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang22" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
        </tr>

        <tr>
	        <td><asp:TextBox ID="GongHuo9" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao9" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao9" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong9" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang9" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        
	        <td><asp:TextBox ID="GongHuo23" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao23" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao23" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong23" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang23" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
        </tr>

        <tr>
	        <td><asp:TextBox ID="GongHuo10" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao10" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao10" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong10" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang10" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        
	        <td><asp:TextBox ID="GongHuo24" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao24" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao24" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong24" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang24" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
        </tr>

        <tr>
	        <td><asp:TextBox ID="GongHuo11" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao11" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao11" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong11" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang11" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        
	        <td><asp:TextBox ID="GongHuo25" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao25" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao25" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong25" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang25" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
        </tr>


        <tr>
	        <td><asp:TextBox ID="GongHuo12" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao12" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao12" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong12" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang12" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        
	        <td><asp:TextBox ID="GongHuo26" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao26" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao26" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong26" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang26" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
        </tr>

        <tr>
	        <td><asp:TextBox ID="GongHuo13" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao13" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao13" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong13" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang13" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        
	        <td><asp:TextBox ID="GongHuo27" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao27" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao27" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong27" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang27" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
        </tr>

        <tr>
	        <td><asp:TextBox ID="GongHuo14" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao14" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao14" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong14" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang14" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        
	        <td><asp:TextBox ID="GongHuo28" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="LuHao28" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunHao28" runat="server" CssClass="intxt1"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunZhong28" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
	        <td><asp:TextBox ID="KunChang28" runat="server" CssClass="blank_center" ReadOnly="True"></asp:TextBox></td>
        </tr>



        <tr>
	        <td align="center">备注</td>
	        <td colspan="6"><asp:TextBox ID="BeiZhu" runat="server" CssClass="intxt1" Width="100%" Height="40px" TextMode="MultiLine"></asp:TextBox></td>
	        <td align="center">车号</td>
	        <td colspan="2"><asp:TextBox ID="CheHao" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox></td>
        </tr>
    </table>
        <table border="0" cellpadding="0" style="width:911px;border-collapse: collapse;font-size:14px;margin-top:4px;">
	            <tr>
                    <td width="25%" nowrap align="center">主管：<asp:DropDownList ID="CangChuZhuGuan" runat="server" 
                            Width="120px" DataSourceID="SqlDataSource3" DataTextField="Value" 
                            DataValueField="Value">
                        </asp:DropDownList>
                    </td>
                    <td width="25%">　</td>
                    <td width="30%">　</td>
                    <td width="20%" nowrap align="center">保管员：<asp:TextBox ID="KuGuanYuan" runat="server" CssClass="blank_center" ReadOnly="True" Width="120px"></asp:TextBox></td>
                </tr>
	        </tr>

        </table>

        <script>    putBillFoot();</script>


    </form>
<form id="form2" method="post" action="/PageExport.ashx">
<input type="hidden" name="filename" value="产品出库清单.doc" />
<input type="hidden" name="content" value="" />
</form>
    <script>
        var textboxs = document.getElementsByTagName("input");
        for (var i = 0; i < textboxs.length; i++) {
            if (textboxs[i].className == "pageturn" || textboxs[i].className == "intxt1" || textboxs[i].className == "intxt2") {
                textboxs[i].onfocus = function(e) { this.select(); };
            }
        }
        function makecalendar(d, o) {
            obj = o;
            idate = makedate(d);
            cdate = new Date(idate.getFullYear(), idate.getMonth(), 1);
            ds.style.left = (getObjectLeft(o)-180) + "px";
            ds.style.top = (getObjectTop(o) + 25) + "px";
            ds.style.display = 'block';
            showcalendar();
        }
        var textboxs = document.getElementsByTagName("input");
        document.body.onkeypress = function(e) {
            if (!e) e = window.event;
            var tag = e.srcElement;
            if (!tag) tag = e.target;
            if (tag.className.toLowerCase() != "intxt1") return;
            var i,j;
            if (e.keyCode == 13) {
                if(tag.id=="DanHao")
                {
                    document.getElementById("KunHao1").focus();
                }
                else if(tag.id.substr(0,6)=="KunHao")
                {
                    var n=Number(tag.id.substr(6));
                    if(n<28)
                    {
                        document.getElementById("KunHao"+(n+1)).focus();
                        document.getElementById("Message").innerHTML="·准备就绪";

                    }
                }
            }
        };
        
    function Export() {
        var ti="<table border=0 cellpadding=0 cellspacing=0 style=text-align:center;border-collapse:collapse;font-size:14px;>"
            +"<tr><td colspan=10 style=font-size:24px;>陕西延长石油材料有限公司<br>产品出库清单</td></tr>";
        ti+="<tr><td colspan=2 align=left style=padding-left:20px;>"+document.getElementById("RiQi").value+"</td>";
        ti+="<td colspan=6></td><td colspan=2>编码：SYC/ZJ-WL-20</td></tr>";
        ti+="<tr><td class=c1>订货单位</td><td class=c1 colspan=2>"+document.getElementById("DingHuo").value+"</td>";
        ti+="<td class=c1>技术条件</td><td class=c1>API Spec5CT</td>"
        ti+="<td class=c1>合 同 号</td><td class=c1 colspan=2>"+document.getElementById("HeTongHao").value+"</td>";
        ti+="<td class=c1>序 号</td><td class=c1>"+document.getElementById("DanHao").value+"</td></tr>";
        ti+="<tr><td class=c1>产品类别</td><td class=c1>"+document.getElementById("ChanPin").value+"</td>";
        ti+="<td class=c1>钢级</td><td class=c1>"+document.getElementById("GangJi").value+"</td>";
        ti+="<td class=c1>规格(mm)</td><td class=c1>"+document.getElementById("GuiGe").value+"</td>";
        ti+="<td class=c1>总支数</td><td class=c1>"+document.getElementById("ZongZhiShu").value+"</td>";
        ti += "<td class=c1>生产单位</td><td class=c1>" + document.getElementById("ShengChan").options[document.getElementById("ShengChan").selectedIndex].text + "</td></tr>";
        ti+="<tr><td class=c1>总重量(吨)</td><td class=c1 colspan=2>"+document.getElementById("ZongZhong").value+"</td>";
        ti+="<td class=c1>总件数</td><td class=c1>"+document.getElementById("ZongJian").value+"</td>";
        ti+="<td class=c1>总长度m</td><td class=c1 colspan=2>"+document.getElementById("ZongChang").value+"</td>";
        ti+="<td class=c1>发货方式</td><td class=c1>"+document.getElementById("FaHuoFangShi").value+"</td></tr>";
        ti+="<tr><td class=c1 style=width:100px;>原料供货商</td>";
        ti+="<td class=c1 style=width:90px;>炉号</td>";
        ti+="<td class=c1 style=width:90px;>捆数编号</td>";
        ti+="<td class=c1 style=width:90px;>捆重量(kg)</td>";
        ti+="<td class=c1 style=width:90px;>捆长度(m)</td>";
        ti+="<td class=c1 style=width:100px;>原料供货商</td>";
        ti+="<td class=c1 style=width:90px;>炉号</td>";
        ti+="<td class=c1 style=width:90px;>捆数编号</td>";
        ti+="<td class=c1 style=width:90px;>捆重量(kg)</td>";
        ti+="<td class=c1 style=width:90px;>捆长度(m)</td></tr>";
        
        var foot="<tr><td class=c1>备 注</td><td class=c1 colspan=6>"+document.getElementById("BeiZhu").value+"</td>";
        foot+="<td class=c1>车 号</td><td class=c1 colspan=2>"+document.getElementById("CheHao").value+"</td></tr>";
        foot+="<tr><td height=30 colspan=8 align=left style=padding-left:30px;>主管："+document.getElementById("CangChuZhuGuan").value+"</td>";
        foot+="<td colspan=2 align=left style=padding-left:10px;>保管员："+document.getElementById("KuGuanYuan").value+"</td></tr></table>";
        
        var bo="";
        var f1,f2,f3,f4,f5;
        var o;
        for(var i=1;i<15;i++)
        {
            f1="";
            f2="";
            f3="";
            f4="";
            f5="";
            o=document.getElementById("GongHuo"+i);
            if(o)f1=o.value;
            o=document.getElementById("LuHao"+i);
            if(o)f2=o.value;
            o=document.getElementById("KunHao"+i);
            if(o)f3=o.value;
            o=document.getElementById("KunZhong"+i);
            if(o)f4=o.value;
            o=document.getElementById("KunChang"+i);
            if(o)f5=o.value;
            bo+="<tr><td class=c1>"+f1+"</td><td class=c1>"+f2+"</td><td class=c1>"+f3+"</td><td class=c1>"+f4+"</td><td class=c1>"+f5+"</td>";

            f1="";
            f2="";
            f3="";
            f4="";
            f5="";
            o=document.getElementById("GongHuo"+(i+14));
            if(o)f1=o.value;
            o=document.getElementById("LuHao"+(i+14));
            if(o)f2=o.value;
            o=document.getElementById("KunHao"+(i+14));
            if(o)f3=o.value;
            o=document.getElementById("KunZhong"+(i+14));
            if(o)f4=o.value;
            o=document.getElementById("KunChang"+(i+14));
            if(o)f5=o.value;
            bo+="<td class=c1 >"+f1+"</td><td class=c1>"+f2+"</td><td class=c1>"+f3+"</td><td class=c1>"+f4+"</td><td class=c1>"+f5+"</td></tr>";
            
        }

        form2.content.value = "<style>@page Section1{size:23.0cm 16.0cm;margin:1.5cm 1cm 1cm 1cm;size:29.7cm 21.0cm;text-align:center;}"
            + "div.Section1{page:Section1;}td.c1{height:26px;border:1px solid #000000;}</style><div class=Section1>"
            + ti+bo+foot+"<br clear=all style=page-break-before:always>"+ti+bo.replace(/<tr><td class=c1>[^<]+</g,"<tr><td class=c1><").replace(/<tr><td class=c1 >[^<]+</g,"<tr><td class=c1><")+foot;
            + "</div>";
        form2.submit();
    }
    
    </script>
</body>
</html>
